var mongoose = require('mongoose')
var Schema = mongoose.Schema
//连接数据库
mongoose.connect('mongodb://localhost/admin',{
  useNewUrlParser: true,
  useUnifiedTopology: true,
  useFindAndModify: false,
  useCreateIndex: true
});


var userSchema = new Schema({
	email:{
		type:String,
		required:true
	},
	id:{
		type:String,
		required:true 
	},
	password:{
		type:String,
		required:true
	},
	picture:{
		type:String,
		default:''
	},
	create_date:{
		type:Date,
		default:Date.now
	},
	last_create_date:{
		type:Date,
		default:Date.now
	},
	avatar:{
		type:String,
		default:'../img/avatar.png'
	},
	mine_bio:{
		type:String,
		default:''
	}
})
module.exports = mongoose.model('User',userSchema)